#include "StartMenuWidget.h"
#include "ui_StartMenuWidget.h"

StartMenuWidget::StartMenuWidget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::StartMenuWidget)
{
    ui->setupUi(this);

    this->setAutoFillBackground(true);           // 启用自动填充背景
    this->setAttribute(Qt::WA_StyledBackground); // 确保样式表应用到背景

    connect(ui->startButton, &QPushButton::clicked, this, &StartMenuWidget::startGame);
    connect(ui->loadButton, &QPushButton::clicked, this, &StartMenuWidget::loadGame);
    connect(ui->helpButton, &QPushButton::clicked, this, &StartMenuWidget::helpShow);
    connect(ui->quitButton, &QPushButton::clicked, this, &StartMenuWidget::quitGame);
}

StartMenuWidget::~StartMenuWidget()
{
    delete ui;
}
